//
//  SmallCollectionView.m
//  WXMovie
//
//  Created by mac106 on 16/4/6.
//  Copyright © 2016年 无限互联. All rights reserved.
//

#import "SmallCollectionView.h"
#import "SmallCell.h"

#define kCellID @"SmallCell"


@implementation SmallCollectionView

- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout {
    if (self = [super initWithFrame:frame collectionViewLayout:layout]) {
        self.itemWidth = kScreenWidth / 4.5;
        [self registerNib:[UINib nibWithNibName:@"SmallCell" bundle:nil] forCellWithReuseIdentifier:kCellID];
    }
    return self;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    SmallCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCellID forIndexPath:indexPath];
    cell.model = self.dataArray[indexPath.row];
    return cell;
}

@end
